class LeaveRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;

	LeaveRenderer(ITexture *texture) :
		Texture(texture)
	{
	}

	int GetTypeData(const int &data)
	{
		return data & ~(0x04 | 0x08);
	}

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		Point2i texPos;
		Colorb color;

		switch ((block.Data & 0x01) | (block.Data & 0x02))
		{
			case 0:
			default:
				color = Colorb(73, 205, 51, 255);
				texPos = Point2i(4 * 16, 3 * 16);
				break;
			case 1:
				color = Colorb(71, 112, 71, 255);
				texPos = Point2i(4 * 16, 8 * 16);
				break;
			case 2:
				color = Colorb(114, 148, 76, 255);
				texPos = Point2i(4 * 16, 3 * 16);
				break;
			case 3:
				color = Colorb(32, 146, 4, 255);
				texPos = Point2i(4 * 16, 12 * 16);
				break;
		}

		renderer->Draw(Box(Texture).SetAll(texPos, color));
	}
};